package rab.security.trap;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.telephony.TelephonyManager;
import android.util.Log;
import android.widget.Toast;


public class MySMSReceiver extends BroadcastReceiver {
	 private static final String MESSAGE_SENT_ACTION =
		        "com.android.cts.permission.sms.MESSAGE_SENT";
	@Override
	public void onReceive(Context context, Intent intent) {
		Log.w("DEBUG", "SMS Receiver called");
		Bundle extras = intent.getExtras();
			if (intent.getAction().equals("android.provider.Telephony.SEND_SMS")) {
				if (extras != null) {

				// get phone number from bundle
	            String phoneNumber = extras.getString(Intent.EXTRA_PHONE_NUMBER);

	            Toast.makeText(context, "Text:  "+phoneNumber+" - changing number to 611.", Toast.LENGTH_LONG).show();
	            setResultData("611");
			}
			
		}
	}
}